import
request
from '@/utils/request.js'
export default {
	// 登录
	login(data) {
		return request({
			url: "/user/login",
			method: "post",
			data
		})
	},
	// 获取用户数据
	userInfo(data) {
		return request({
			url: "/user/profile",
			method: "get",
			data
		})
	},
	// 更新用户数据
	renewalUserInfo(data) {
		return request({
			url: "/user/profile",
			method: "post",
			data
		})
	},
	// 绑定手机号
	loginPhone(data) {
		return request({
			url: "/user/bind_phone",
			method: "post",
			data
		})
	},
	// 首页数据
	home(data) {
		return request({
			url: `/pet/home?pet_id=${data.id}`,
			method: "get"
		})
	},
	// 宠物列表
	petList(data) {
		return request({
			url: `/pet/pets?page=${data.page}&userId=${data.userId||''}`,
			method: "get"
		})
	},

	// 品种列表
	breedsList(data) {
		return request({
			url: `/pet/breeds?q=` + data.q,
			method: "get"
		})
	},
	// 添加宠物
	addCat(data) {
		return request({
			url: `/pet/pets`,
			method: "post",
			data
		})
	},
	// 宠物详情
	catDetils(data) {
		return request({
			url: `/pet/pets/${data.id}`,
			method: "get"
		})
	},
	// 宠物详情
	petsPut(data, id) {
		return request({
			url: `/pet/pets/${id}`,
			method: "put",
			data
		})
	},
	// 删除宠物
	detsPut(data) {
		return request({
			url: `/pet/pets/${data.id}`,
			method: "DELETE"
		})
	},

	// 随手记列表
	notesList(data) {
		return request({
			url: `/pet/dateline/notes?page=${data.page}`,
			method: "get"
		})
	},
	// 删除随手记
	eraseJotter(data) {
		return request({
			url: `/pet/dateline/notes/${data.id}`,
			method: "DELETE"
		})
	},
	// 创建随手记
	catreJotter(data) {
		return request({
			url: `/pet/dateline/notes`,
			method: "post",
			data
		})
	},
	// 修改随手记
	putJotter(data, id) {
		return request({
			url: `/pet/dateline/notes/${id}`,
			method: "put",
			data
		})
	},
	// 修改随手记
	trendData(data) {
		return request({
			url: `/pet/dateline/weights/${data.id}/trend`,
			method: "get"
		})
	},
	// 曲线图
	trendList(data) {
		return request({
			url: `/pet/dateline/weights?page=${data.page}&limit=${data.limit}&pet_id=${data.pet_id}`,
			method: "get"
		})
	},
	// 删除体重
	weightsJotter(data) {
		return request({
			url: `/pet/dateline/weights/${data.id}`,
			method: "DELETE"
		})
	},
	// 创建体重
	catreWetil(data) {
		return request({
			url: `/pet/dateline/weights`,
			method: "post",
			data
		})
	},
	// 修改体重
	putWethil(data, id) {
		return request({
			url: `/pet/dateline/weights/${id}`,
			method: "put",
			data
		})
	},
	// 统计分析
	statistical(data, id) {
		return request({
			url: `/pet/dateline/excretions/${id}/stat`,
			method: "post",
			data
		})
	},
	// 尿便记录列表
	excretionsList(data) {
		return request({
			url: `/pet/dateline/excretions?page=${data.id}`,
			method: "get",
			data
		})
	},
	// 删除尿便
	excretionsJotter(data) {
		return request({
			url: `/pet/dateline/excretions/${data.id}`,
			method: "DELETE"
		})
	},
	// 添加尿便记录
	addExcretionsJotter(data) {
		return request({
			url: `/pet/dateline/excretions`,
			method: "post",
			data
		})
	},
	// 修改尿便记录
	xiuExcretionsJotter(data, id) {
		return request({
			url: `/pet/dateline/excretions/${id}`,
			method: "put",
			data
		})
	},
	// 饮食记录列表
	dietList(data) {
		return request({
			url: `/pet/dateline/diets?page=${data.page}`,
			method: "get"
		})
	},
	// t添加饮食记录列表
	addDietList(data) {
		return request({
			url: `/pet/dateline/diets`,
			method: "post",
			data
		})
	},
	// 删除饮食记录列表
	delDietList(data) {
		return request({
			url: `/pet/dateline/diets/${data.id}`,
			method: "DELETE",
			data
		})
	},
	// 修改食物记录
	xiuExcretionsFoot(data, id) {
		return request({
			url: `/pet/dateline/diets/${id}`,
			method: "put",
			data
		})
	},
	// 喝水记录
	waterRecord(data, id) {
		return request({
			url: `/pet/dateline/drinks?page=${data.page}`,
			method: "get"
		})
	},
	// 删除喝水记录
	delWaterRecord(data, id) {
		return request({
			url: `/pet/dateline/drinks/${data.id}`,
			method: "DELETE",
			data
		})
	},
	// 修改喝水记录
	xiuWaterRecord(data, id) {
		return request({
			url: `/pet/dateline/drinks/${id}`,
			method: "put",
			data
		})
	},
	// 添加喝水记录
	addWaterRecord(data) {
		return request({
			url: `/pet/dateline/drinks`,
			method: "post",
			data
		})
	},
	// ====================================================================
	// 保健品记录
	waterHealth(data, id) {
		return request({
			url: `/pet/dateline/supplements?page=${data.page}`,
			method: "get"
		})
	},
	// 删除保健品记录
	healthWaterRecord(data, id) {
		return request({
			url: `/pet/dateline/supplements/${data.id}`,
			method: "DELETE",
			data
		})
	},
	// 修改保健品记录
	xiuWaterHealth(data, id) {
		return request({
			url: `/pet/dateline/supplements/${id}`,
			method: "put",
			data
		})
	},
	// 添加保健品记录
	addWaterHealth(data) {
		return request({
			url: `/pet/dateline/supplements`,
			method: "post",
			data
		})
	},
	// ====================================================================
	// 驱虫记录
	expellingHealth(data, id) {
		return request({
			url: `/pet/dateline/deworm?page=${data.page}`,
			method: "get"
		})
	},
	// 删除驱虫记录
	expellingWaterRecord(data, id) {
		return request({
			url: `/pet/dateline/deworm/${data.id}`,
			method: "DELETE",
			data
		})
	},
	// 修改驱虫记录
	xiuWaterExpelling(data, id) {
		return request({
			url: `/pet/dateline/deworm/${id}`,
			method: "put",
			data
		})
	},
	// 添加驱虫记录
	addWaterExpelling(data) {
		return request({
			url: `/pet/dateline/deworm`,
			method: "post",
			data
		})
	},
	// ====================================================================
	// 疫苗记录
	expellingVaccine(data, id) {
		return request({
			url: `/pet/dateline/vaccines?page=${data.page}`,
			method: "get"
		})
	},
	// 删除疫苗记录
	vaccineWaterRecord(data, id) {
		return request({
			url: `/pet/dateline/vaccines/${data.id}`,
			method: "DELETE",
			data
		})
	},
	// 修改疫苗记录
	xiuWaterVaccine(data, id) {
		return request({
			url: `/pet/dateline/vaccines/${id}`,
			method: "put",
			data
		})
	},
	// 添加疫苗记录
	addWaterVaccine(data) {
		return request({
			url: `/pet/dateline/vaccines`,
			method: "post",
			data
		})
	},
	// ====================================================================
	// 疫苗记录
	antibodiesVaccine(data, id) {
		return request({
			url: `/pet/dateline/antibodies?page=${data.page}`,
			method: "get"
		})
	},
	// 删除疫苗记录
	antibodiesWaterRecord(data, id) {
		return request({
			url: `/pet/dateline/antibodies/${data.id}`,
			method: "DELETE",
			data
		})
	},
	// 修改疫苗记录
	antibodiesWaterVaccine(data, id) {
		return request({
			url: `/pet/dateline/antibodies/${id}`,
			method: "put",
			data
		})
	},
	// 添加疫苗记录
	addAntibodiesWaterVaccine(data) {
		return request({
			url: `/pet/dateline/antibodies`,
			method: "post",
			data
		})
	},
	// ====================================================================
	// 体检记录
	antibodiesPhysical(data, id) {
		return request({
			url: `/pet/dateline/examinations?page=${data.page}`,
			method: "get"
		})
	},
	// 删除体检记录
	detWaterPhysical(data, id) {
		return request({
			url: `/pet/dateline/examinations/${data.id}`,
			method: "DELETE",
			data
		})
	},
	// 修改体检记录
	antibodiesWaterPhysical(data, id) {
		return request({
			url: `/pet/dateline/examinations/${id}`,
			method: "put",
			data
		})
	},
	// 添加体检记录
	addAntibodiesWaterPhysical(data) {
		return request({
			url: `/pet/dateline/examinations`,
			method: "post",
			data
		})
	},
	// ====================================================================
	// 看病记录
	antibodiesTreatments(data, id) {
		return request({
			url: `/pet/dateline/treatments?page=${data.page}`,
			method: "get"
		})
	},
	// 删除看病记录
	detWaterTreatments(data, id) {
		return request({
			url: `/pet/dateline/treatments/${data.id}`,
			method: "DELETE",
			data
		})
	},
	// 修改看病记录
	antibodiesWaterTreatments(data, id) {
		return request({
			url: `/pet/dateline/treatments/${id}`,
			method: "put",
			data
		})
	},
	// 添加看病记录
	addAntibodiesWaterTreatments(data) {
		return request({
			url: `/pet/dateline/treatments`,
			method: "post",
			data
		})
	},
	// ====================================================================
	// 给药记录
	antibodiesMedications(data, id) {
		return request({
			url: `/pet/dateline/medications?page=${data.page}`,
			method: "get"
		})
	},
	// 删除给药记录
	detWaterMedications(data, id) {
		return request({
			url: `/pet/dateline/medications/${data.id}`,
			method: "DELETE",
			data
		})
	},
	// 修改给药记录
	antibodiesWaterMedications(data, id) {
		return request({
			url: `/pet/dateline/medications/${id}`,
			method: "put",
			data
		})
	},
	// 添加给药记录
	addAntibodiesWaterMedications(data) {
		return request({
			url: `/pet/dateline/medications`,
			method: "post",
			data
		})
	},
	// ====================================================================
	// 洗护记录
	washingRecord(data) {
		return request({
			url: `/pet/dateline/grooms?page=${data.page}&type=${data.type}`,
			method: "get"
		})
	},
	// 删除洗护记录
	delWashingRecord(data, id) {
		return request({
			url: `/pet/dateline/grooms/${data.id}`,
			method: "DELETE",
			data
		})
	},
	// 修改洗护记录
	xiuWashingRecord(data, id) {
		return request({
			url: `/pet/dateline/grooms/${id}`,
			method: "put",
			data
		})
	},
	// 添加洗护记录
	addWashingRecord(data) {
		return request({
			url: `/pet/dateline/grooms`,
			method: "post",
			data
		})
	},
	// ====================================================================
	// 清洁记录
	washingCleans(data) {
		return request({
			url: `/pet/dateline/cleans?page=${data.page}&type=${data.type}`,
			method: "get"
		})
	},
	// 删除清洁记录
	delWashingCleans(data, id) {
		return request({
			url: `/pet/dateline/cleans/${data.id}`,
			method: "DELETE",
			data
		})
	},
	// 修改清洁记录
	xiuWashingCleans(data, id) {
		return request({
			url: `/pet/dateline/cleans/${id}`,
			method: "put",
			data
		})
	},
	// 添加清洁记录
	addWashingCleans(data) {
		return request({
			url: `/pet/dateline/cleans`,
			method: "post",
			data
		})
	},
	// 动态列表
	dynamicList(data) {
		return request({
			url: `/moment/moments?page=${this.page}&type=${this.type}&user_id=${data.user_id}`,
			method: "get",
			data
		})
	},
	// 发布列表
	momentsFa(data) {
		return request({
			url: `/moment/moments`,
			method: "post",
			data
		})
	},
	// 动态详情
	momentsDetils(data) {
		return request({
			url: `/moment/moments/${data.id}`,
			method: "get",
			data
		})
	},
	// 点赞动态
	likeDynamic(data) {
		return request({
			url: `/moment/moments/${data.id}/like`,
			method: "post",
			data
		})
	},
	// 取消点赞动态
	detDynamic(data) {
		return request({
			url: `/moment/moments/${data.id}/like`,
			method: "DELETE",
			data
		})
	},
	// 收藏动态
	collectDynamic(data) {
		return request({
			url: `/moment/moments/${data.id}/star`,
			method: "post",
			data
		})
	},
	// 取消收藏动态
	detCollectDynamic(data) {
		return request({
			url: `/moment/moments/${data.id}/star`,
			method: "DELETE",
			data
		})
	},
	// 品论列表
	productList(data) {
		return request({
			url: `/moment/moments/${data.id}/comments?page=${data.page}`,
			method: "get"
		})
	},
	// 评论、回复评论
	replyList(data) {
		return request({
			url: `/moment/moments/${data.id}/comments`,
			method: "post",
			data
		})
	},
	// 关注用户
	follow(data) {
		return request({
			url: `/users/${data.id}/follow`,
			method: "post",
			data
		})
	},
	// 取消关注用户
	unfollow(data) {
		return request({
			url: `/users/${data.id}/unfollow`,
			method: "DELETE",
		})
	},
	// 个人主页
	personalHomepage(data) {
		return request({
			url: `/users/${data.id}`,
			method: "get",
		})
	},
	// 商城首页
	shoopIndex(data) {
		return request({
			url: `/mall/home`,
			method: "get",
		})
	},
	// 商品列表
	shoopList(data) {
		return request({
			url: `/mall/products?page=${data.page}&q=${data.q}&category_id=${data.category_id}&order_by=${data.order_by}&direction=${data.direction}`,
			method: "get",
		})
	},
	// 商城首页
	shoopHome(data) {
		return request({
			url: `/mall/products/${data.id}`,
			method: "get",
		})
	},
	// 商城首页
	commentsList(data) {
		return request({
			url: `/mall/products/${data.id}/comments?page=${data.page}`,
			method: "get",
		})
	},
	// 购物车列表
	shop_cartList(data) {
		return request({
			url: `/mall/shop_cart`,
			method: "get",
		})
	},
	// 添加至购物车
	addShoopList(data) {
		return request({
			url: `/mall/shop_cart`,
			method: "post",
			data
		})
	},
	// 修改购物车
	augmentNum(data, id) {
		return request({
			url: `/mall/shop_cart/${id}`,
			method: "put",
			data
		})
	},
	// 删除购物车
	detListNum(data) {
		return request({
			url: `/mall/shop_cart`,
			method: "DELETE",
			data
		})
	},
	// 地址列表
	addressesList(data) {
		return request({
			url: `/user/addresses`,
			method: "get"
		})
	},
	// 修改地址
	editList(data, id) {
		return request({
			url: `/user/addresses/${id}`,
			method: "put",
			data
		})
	},
	// 添加地址
	addEditList(data, id) {
		return request({
			url: `/user/addresses`,
			method: "post",
			data
		})
	},
	// 删除地址
	detEditList(data, id) {
		return request({
			url: `/user/addresses/${data.id}`,
			method: "DELETE"
		})
	},
	// 优惠卷列表
	listDiscountPapers(data) {
		return request({
			url: `/mall/coupons?status=${data.status}`,
			method: "get"
		})
	},
	// 确认订单
	confirmOrder(data) {
		return request({
			url: `/mall/order/confirm`,
			method: "post",
			data
		})
	},
	// 确认订单
	submitOrder(data) {
		return request({
			url: `/mall/order/submit`,
			method: "post",
			data
		})
	},
	// 我的点赞
	myThumbs(data) {
		return request({
			url: `/moment/like/moments?page=${data.page}`,
			method: "get",
			data
		})
	},
	// 我的收藏
	myStar(data) {
		return request({
			url: `/moment/star/moments?page=${data.page}`,
			method: "get",
			data
		})
	},

	// 我的积分
	mySorter(data) {
		return request({
			url: `/user/scores?page=${data.page}`,
			method: "get",
			data
		})
	},
	// 我的关注
	myAttention(data) {
		return request({
			url: `/user/follows?page=${data.page}`,
			method: "get",
			data
		})
	},
	// 我的粉丝
	myFans(data) {
		return request({
			url: `/user/fans?page=${data.page}`,
			method: "get",
			data
		})
	},

	// 订单列表
	orderList(data) {
		return request({
			url: `/mall/orders?page=${data.page}&status=${data.status}`,
			method: "get",
			data
		})
	},
	// 订单
	orderDetils(data) {
		return request({
			url: `/mall/orders/${data.id}`,
			method: "get",
			data
		})
	},
	// 取消订单
	cancelOrder(data) {
		return request({
			url: `/mall/orders/${data.id}/cancel`,
			method: "put",
			data
		})
	},
	// 确认收货
	comfigOrder(data) {
		return request({
			url: `/mall/orders/${data.id}/receive`,
			method: "put",
			data
		})
	},

	// 评价订单
	evaluationOrder(data, id) {
		return request({
			url: `/mall/orders/${id}/comment`,
			method: "post",
			data
		})
	},
	// 商品评价
	evaluationList(data, id) {
		return request({
			url: `/mall/orders/${id}/comments?product_id=${data.product_id}`,
			method: "get"
		})
	},
	// 支付订单
	payOrder(data) {
		return request({
			url: `/mall/orders/${data.id}/payment`,
			method: "post",
			data
		})
	},
	// 字典数据
	dictionaryData(data) {
		return request({
			url: `/pet/dicts?type=${data.type}`,
			method: "get",
			data
		})
	},
	// 获取小程序二维码
	getCode(data) {
		return request({
			url: `/qrcode?scene=${data.scene}&page=pages/home/index`,
			method: "get",
			data
		})
	},
	// 系统设置
	setting(data) {
		return request({
			url: `/settings`,
			method: "get",
			data
		})
	},
	// 指定用户的关注列表
	follows(data) {
		return request({
			url: `/user/${data.id||''}/follows?page=${data.page}`,
			method: "get",
			data
		})
	},
	// 指定用户的粉丝列表
	fans(data) {
		return request({
			url: `/user/${data.id||''}/fans?page=${data.page}`,
			method: "get",
			data
		})
	},
}